#ifndef _Bomb_H_
#define _Bomb_H_

#include "Weapon.h"
#include "../Utils/Vector2D.h"
#include "../Ship.h"
#include "../Player.h"
#include "../Map.h"
#include "../Sound/Sound.h"


class BombProjectile : public WeaponProjectile {
  public:
    BombProjectile(Player *parent_player, Vector2D target,
                   float speed, unsigned count);

    ~BombProjectile();

    void render(void);
    void update(void);
    bool active(void);

    bool resolveCollision(Ship *ship);
    bool resolveCollision(Weapon *weapon);
    bool resolveCollision(Map *map);

  private:
    Player *parent_player;
    Vector2D target;
    bool is_active;

    Vector2D position, prev_position;
    Vector2D velocity;
    Vector2D fire_direction;
    Vector2D perp_fire_direction;
    unsigned texture_id;

    void explode(void);

};

class Bomb : public WeaponGenerator {
  public:

    Bomb(int ammo_count, int lifetime, Ship *pship);
    ~Bomb();

    bool shouldDiscard(void);
    bool fire(void);

  private:
    const SndInfo* bomb_sound;
    unsigned num_bombs_fired;
};


#endif

